import request from '@/utils/request.js';

// 获取所有用户信息
export const getUsersApi = (data) => {
    return request.get('/xl/api/v1/users', data);
}

// 添加用户
export const addUserApi = (data) => {
    return request.post('/xl/api/v1/users', data);
}

//获取用户详情
export const getUserInfoApi = (id) => {
    return request.get(`/xl/api/v1/users/${id}`);
}

// 编辑用户
export const editUserApi = (data) => {
    return request.put(`/xl/api/v1/users`, data);
}

// 批量删除用户
export const deleteUserApi = (ids) => {
    // 注意这里还要套一层data
    return request.delete(`/xl/api/v1/users/batch`, { data: ids });
}